package com.slashvision.im.tool

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import com.slashvision.im.ContextUtil

/**
 * author : lizhenxin
 *  date  : 2021/11/17
 *  desc  :
 */
object ClipboardUtil {
    private val cm = ContextUtil.getContext().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager

    fun copy2Clipboard(str:String) {
        val data = ClipData.newPlainText(str, str)
        cm.setPrimaryClip(data)
    }
}